import { ElMessage, ElNotification, type NotificationProps } from 'element-plus'

// 成功消息
export const successMsg = (message: string) => {
  ElMessage({
    message: message || '操作成功',
    type: 'success',
    duration: 2000,
  })
}

// 错误消息
export const errorMsg = (message: string) => {
  ElMessage({
    message: message || '操作失败',
    type: 'error',
    duration: 3000,
  })
}

// 通知提示
export const notify = (options: NotificationProps) => {
  const opt = { ...options }
  opt.title = opt.title || '系统通知'
  ElNotification(opt)
}
